Repository navigation
fix(permissions): allow decision-script reads, ask on --set/--clear, stop allowing install-claude-hooks.sh (#782) - #785
Merged
Conversation
…stop allowing install-claude-hooks.sh (#782) exec-approval.sh, interview-mode.sh and permission-profile.sh get allow rules again, so the read before every exec no longer prompts under exec approval `auto`. Their only writers, `--set` and `--clear`, sit behind six shared ask rules under every profile; ask beats allow. install-claude-hooks.sh joins the exclusion list: it writes ~/.claude/settings.json for every repo. Migration goes through the existing sidecars; foreign entries are untouched. Field run, claude 2.1.325: the read ran with no denial, `--set auto` and `--clear` were refused, and with the ask rules removed `--set` ran. Fixes #782 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HXpQSjXefSNicGGqP4aiSC
Owner
Author
|
Review: MERGE. No ordinary spelling of a state-changing call to the three scripts gets past Value: Fixes #782 as reported.
Regression risk:
Correctness:
Context cost: 66,271 → 66,271 (measured). Time cost: install and Generated by Claude Code |
5 of 7 tasks
…on-followups # Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #782
Direct lane
What changed and why (one paragraph): #781 kept every script that records a person's decision out of the allow list. That kept
--setprompting. But it also meant the read before each exec (<toolkit>/bin/exec-approval.sh <project>,bin/lib/wiring-item3.sh:33) prompted every time, so exec approvalautostill prompted on every exec. The same applied tointerview-mode.sh <proj> --explainand thepermission-profile.shread. Meanwhileinstall-claude-hooks.shstill got an allow rule, although it writes~/.claude/settings.jsonand its hooks fire in every repo on the machine.What changes in
bin/install-claude-permissions.sh:exec-approval.sh,interview-mode.shandpermission-profile.sh, with the same per-script rules as every other script. They exist only in the toolkit'sbin/, so the rules are the local absolute-path ones.--set <value>and--clear;--explain,--remoteand the bare call only read. Sixaskrules cover the writers:Bash(*<script>*--set*)andBash(*<script>*--clear*). They go into the sharedsettings.jsonunder every profile,wrappersincluded. An ask rule beats an allow rule, includingfull's bareBash.install-claude-hooks.sh. It joins the exclusioncase,EXPECTED_LOCALand the T12 grep.Migration goes through the existing sidecars:
--check(and sosync-project.sh's WARN) names the stale rule and the missing ask rules until that re-install.Impact
sync-project.sh's existing permission--checkWARN fires once on every project installed before this change, untilinstall-harness-permissions.sh <project>is re-run. After the re-install, under exec approvalauto, the per-exec mode read no longer prompts.--set/--clearof the three scripts now prompts in every profile. That is new underfull, where the bareBashused to let them through.bin/install-claude-permissions.sh, the fixture and CHANGELOG only. It builds on #781, which is merged. Exit codes and output format are unchanged.--checkstay at ~0.14 s, within noise. Nothing runs per exec. Sharedsettings.jsongains 6 ask rules. Localsettings.local.jsongains 6 allow rules and loses 2 (the hooks installer).Time cost: per project (install/sync check) · ±0.01 s on a Linux container · can force rework: n · offset: removes the permission prompt on the exec-approval read before every exec under
auto, and oninterview-mode.sh --explainField evidence (claude 2.1.325, 2026-11-16; the maintainer authorised small model calls for this proof, as for #781). Setup: a throwaway project installed by this branch with the
wrappersprofile. The shared and local files were merged and passed through--settings, and each command was run withclaude -p … --permission-mode default --output-format json --max-turns 3.permission_denials<tk>/bin/exec-approval.sh <proj>autobash <tk>/bin/interview-mode.sh <proj> --explain<tk>/bin/exec-approval.sh <proj> --set auto<tk>/bin/permission-profile.sh <proj> --clear<tk>/bin/install-claude-hooks.sh --dry-run --full<tk>/bin/exec-approval.sh <proj>.claude/(control)--set ask--set autoaskThe control shows that the ask rule is what stops
--set.--debugalso shows that Claude Code drops a not-yet-trusted workspace's project allow entries but still applies its project ask and deny rules. So the committed ask rules protect even an untrusted checkout.Fixture:
tests/wave2/test-install-claude-permissions.sh. T12 gains seven cases (one existing case is reworded), and its matcher now applies "ask beats allow". The cases check:--setand--clearspelling hits an ask rule;full;--checkon an install shaped like fix(permissions): one allow rule per script, * only at the end (#780) #781's output names the stale and missing rules;Results:
Other fixtures:
test-look-hook-cwd.sh9/0 andtest-look-ledger-hook-repair.sh13/0.test-model-stamp.shT8 replicated by hand: all four checks hold.test-file-bugs.sh's permission check, by inspection: the deny strings are unchanged.check-scripts, the leak guard,check-portabilityandcheck-pr-disciplineare clean.Not covered here: under the
projectprofile,Edit(/**)still lets the Edit tool write.mxtk/exec-approvalor theExec approval:line in PROJECT.md directly. That gap was there before this PR and is outside #782's scope.CHANGELOG.mdline appended, crediting the two independent reviews of fix(permissions): one allow rule per script, * only at the end (#780) #781Review: pending independent review
Generated by Claude Code